package com.ruoyi.wms.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.ruoyi.wms.mapper.WmsStockMapper;
import com.ruoyi.wms.domain.WmsStock;
import com.ruoyi.wms.service.IWmsStockService;

import javax.annotation.Resource;

/**
 * 仓库Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-23
 */
@Service
public class WmsStockServiceImpl implements IWmsStockService 
{
    @Resource
    private WmsStockMapper wmsStockMapper;

    /**
     * 查询仓库
     * 
     * @param stockUuid 仓库主键
     * @return 仓库
     */
    @Override
    public WmsStock selectWmsStockByStockUuid(String stockUuid)
    {
        return wmsStockMapper.selectWmsStockByStockUuid(stockUuid);
    }

    /**
     * 查询仓库列表
     * 
     * @param wmsStock 仓库
     * @return 仓库
     */
    @Override
    public List<WmsStock> selectWmsStockList(WmsStock wmsStock)
    {
        return wmsStockMapper.selectWmsStockList(wmsStock);
    }
    @Override
    public List<WmsStock> listStockUuid(WmsStock wmsStock)
    {
        return wmsStockMapper.listStockUuid(wmsStock);
    }
    /**
     * 按仓库类别多选查询仓库列表
     *
     * @param wmsDictStockType 仓库
     * @return 仓库
     */
    @Override
    public List<WmsStock> listByWmsDictStockType(String[] wmsDictStockType)
    {
        return wmsStockMapper.listByWmsDictStockType(wmsDictStockType);
    }

    /**
     * 新增仓库
     * 
     * @param wmsStock 仓库
     * @return 结果
     */
    @Override
    public int insertWmsStock(WmsStock wmsStock)
    {
        wmsStock.setCreateTime(DateUtils.getNowDate());
        return wmsStockMapper.insertWmsStock(wmsStock);
    }

    /**
     * 修改仓库
     * 
     * @param wmsStock 仓库
     * @return 结果
     */
    @Override
    public int updateWmsStock(WmsStock wmsStock)
    {
        wmsStock.setUpdateTime(DateUtils.getNowDate());
        return wmsStockMapper.updateWmsStock(wmsStock);
    }
 /**
     * 修改仓库
     *
     * @param wmsStock 仓库
     * @return 结果
     */
    @Override
    public int updateWmsStockAll(WmsStock wmsStock)
    {
        wmsStock.setUpdateTime(DateUtils.getNowDate());
        return wmsStockMapper.updateWmsStockAll(wmsStock);
    }

    /**
     * 批量删除仓库
     * 
     * @param stockUuids 需要删除的仓库主键
     * @return 结果
     */
    @Override
    public int deleteWmsStockByStockUuids(String[] stockUuids)
    {
        return wmsStockMapper.deleteWmsStockByStockUuids(stockUuids);
    }

    /**
     * 删除仓库信息
     * 
     * @param stockUuid 仓库主键
     * @return 结果
     */
    @Override
    public int deleteWmsStockByStockUuid(String stockUuid)
    {
        return wmsStockMapper.deleteWmsStockByStockUuid(stockUuid);
    }
}
